﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DemoApp1
{
    class ArrayDemo
    {

        public void Index()
        {
            int[] intArr = new int[] {1, 2, 3, 4, 789, 123, 100, 6};
             

            Console.WriteLine("数字6 的 索引是" + Array.IndexOf(intArr, 6));

            var str = "123456789";
            var i = str.IndexOf('6');
            Console.WriteLine("6的索引是" + i);


        }
    }
}
